Looking for  PowerShell Script

I'm looking for a PowerShell script that I can run and will copy a file with today's date yyyymmdd.txt  to a remote location renaming it to XXXXXX.log and over writing the existing *.log.   

Sounds simple, but as a newbe to PS, I could use some help.

February 10th, 2015 6:35pm

Check out: Get-Help Copy-Item -Full

That cmdlet can copy a file from one place to another, rename it, and also overwrite a pre-existing file (-Force).

Also check out Get-Help about_Variables for info on how variables work in PowerShell. You can use Get-Date -Format yyyymmdd to get the values you'll need for your source file name, then save it to a variable to use with Copy-Item.

I don't know what XXXXXX.log represents, but that might just need to be another variable.

Does that help?


Free Windows Admin Tool Kit Click here and download it now
February 10th, 2015 6:55pm

Todays date is:

[datetime]::Today.ToString('yyyyMMdd')

Help Copy-Item -full

February 10th, 2015 6:56pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics